package com.cwrl.spider.test.handle;

import lombok.NoArgsConstructor;
import org.eclipse.leshan.client.object.Device;
import org.eclipse.leshan.client.servers.LwM2mServer;
import org.eclipse.leshan.core.request.BindingMode;
import org.eclipse.leshan.core.response.ReadResponse;

import java.util.EnumSet;

@NoArgsConstructor
public class MyDevice extends Device {

    public MyDevice(String manufacturer, String modelNumber, String serialNumber) {
        super(manufacturer, modelNumber, serialNumber);
    }

    @Override
    public ReadResponse read(LwM2mServer server, int resourceId) {
        System.out.println("serverId -> " +server.getId() + "  -> resourceId = " + resourceId);
        return super.read(server, resourceId);
    }

    @Override
    public ReadResponse read(LwM2mServer server, int resourceId, int resourceInstance) {
        System.out.println("serverId -> " +server.getId() + "  -> resourceId = " + resourceId + " -> resourceInstance = " + resourceInstance);
        return super.read(server, resourceId, resourceInstance);
    }
}
